@extends('admin.layouts.app')

@section('right-content')

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>设置密码</legend>
    </fieldset>

    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-block">
                <input type="password" name="newpassword" value="" lay-verify="required" autocomplete="off" placeholder="请输入新密码" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">再次输入密码</label>
            <div class="layui-input-block">
                <input type="password" name="newpassword1" value="" lay-verify="required" autocomplete="off" placeholder="请再次输入密码" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="demo1" data-url="{{ route('admin.setPwd') }}">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
@endsection

@section('my-js')


    <script type="text/javascript">
        layui.use(['form'], function(){
            var form = layui.form;

            //监听提交
            form.on('submit(demo1)', function(data){
                var url = $(this).attr('data-url');
                commonAjaxSubmit(url,'POST');
            });


        });

    </script>
@endsection